<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>结构赋值的用途 </title>
</head>
<body>
    
</body>
</html>
<SCript>
    //交换两个变量的值
    // let a=10, b=20;
    // // let c;
    // // c=a;
    // // a=b;
    // // b=c;
    // // console.log(a,b);
    // console.log([a,b]=[b,a]);
    //2.从函数返回的值
    //返回数组
    function fn(){
        return [1,2,3,4,5]
    }
    var [a,b,c,d,f]=fn();
    console.log(a,b,c,d,f);
    
    





</SCript>                 